export default {
  data () {
    return {
      theadArr: [
        'selection',
        'enjoy_date',
        'name',
        'code',
        'sex',
        'age',
        'edu',
        'address',
        'work_year',
        'work_experience',
        'apply_time',
        'dispatch_order',
        'accept_order',
        'finish_order',
        'fail_order',
        'ongoing_order',
        'income',
        'feedback',
        'status'
      ]
    }
  },
  methods: {
    // 设置表头
    getTableColumns (arr) {
      const tableColumns = {
        selection: {
          type: 'selection',
          width: 60,
          fixed: 'left'
        },
        name: {
          title: '企业名称',
          align: 'center',
          minWidth: 150,
          key: 'name'
        },
        code: {
          title: '企业编号',
          align: 'center',
          minWidth: 170,
          key: 'code'
        },
        accumulativeOrder: {
          title: '累计已派订单',
          align: 'center',
          minWidth: 120,
          slot: 'accumulativeOrder'
        },
        monthCost: {
          title: '本月发生费用',
          align: 'center',
          minWidth: 120,
          slot: 'monthCost'
        },
        accumulativeCost: {
          title: '累计发生费用',
          align: 'center',
          minWidth: 120,
          slot: 'accumulativeCost'
        },
        action: {
          title: '操作',
          align: 'center',
          slot: 'action',
          minWidth: 120
        }
      }
      let data = []

      arr.forEach(col => data.push(tableColumns[col]))

      return data
    }
  }
}
